package com.company.cloud.user.modules.api.service;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.user.modules.api.fallback.UserPlatformRemoteServiceFallbackFactory;
import com.company.cloud.user.modules.api.models.UserModel;
import com.company.cloud.user.modules.api.request.UserMgrUpdateParam;
import com.company.cloud.user.modules.api.request.UserPtQuery4PageParam;
import com.company.cloud.user.modules.api.request.UserRegisterParam;
import com.company.cloud.user.modules.api.response.UserInfoQueryResp;
import com.company.common.server.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "userPT", name = ServiceNameConstant.user_center, fallbackFactory = UserPlatformRemoteServiceFallbackFactory.class)
public interface UserPlatformRemoteService {

    /**新增用户*/
    @RequestMapping(value = "/remote/userPT/saveUser", method = RequestMethod.POST )
    public BaseClientResult<String> saveUser(@RequestBody UserRegisterParam params);

    /**修改用户信息*/
    @RequestMapping(value = "/remote/userPT/updateUser", method = RequestMethod.POST )
    public BaseClientResult<String> updateUser(@RequestBody UserMgrUpdateParam params);

    /**用户列表查询*/
    @RequestMapping(value = "/remote/userPT/queryUsers", method = RequestMethod.POST )
    public BaseClientResult<List<UserModel>> queryUsers(@RequestBody UserPtQuery4PageParam params);

    /**用户列表查询*/
    @RequestMapping(value = "/remote/userPT/queryUser", method = RequestMethod.POST )
    public BaseClientResult<UserInfoQueryResp> queryUser(@RequestBody UserPtQuery4PageParam params);

    /**用户信息查询*/
    @RequestMapping(value = "/remote/userPT/getUser", method = RequestMethod.GET )
    public BaseClientResult<UserModel> getUser(@RequestParam("id")Integer id);
}
